
/**
 * Class representing a causal link between two actions.
 * That is, a connection between two action which specifies
 * a number of predicates that the first action provides for
 * the second.
 */
public class CausalLink {
	private Action from;
	private Action to;
	
	private Predicate provides;
	
	/**
	 * Constructor for the CausalLink class
	 * @param from
	 * @param to
	 * @param provides
	 */
	public CausalLink(Action from, Action to, Predicate provides) {
		
		this.from = from;
		this.to = to;
		this.provides = provides;
	}

	/**
	 * Returns the from action
	 * @return
	 */
	public Action getFrom() {
		return from;
	}

	/**
	 * Sets the from action
	 * @return
	 */
	public void setFrom(Action from) {
		this.from = from;
	}

	/**
	 * Returns the to action
	 * @return
	 */
	public Action getTo() {
		return to;
	}

	/**
	 * Sets the to action
	 * @return
	 */
	public void setTo(Action to) {
		this.to = to;
	}

	/**
	 * Returns the literal provided by the action
	 * @return
	 */
	public Predicate getProvides() {
		return provides;
	}

	/**
	 * Returns a string representation of the causal link
	 */
	public String toString() {
		return from.toString().toUpperCase() + " -->" + provides + " " + to.toString().toUpperCase();
	}
}
